package com.nwpu.server.authserver.controller;

import com.nwpu.server.authserver.entity.UserEntity;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author: YuXingZh
 * @Date: Created in 18:45 2022-05-09
 * @Description:
 */
public abstract class AbstractController {

    protected UserEntity getUser() {
        return (UserEntity) SecurityUtils.getSubject().getPrincipal();
    }

    protected Long getUserId() {
        return getUser().getUserId();
    }
}

